<template>
  <div class="ebutton" @click="handleOptions">
    <span>{{ text }}</span>
  </div>
</template>

<script>
export default {
  props: {
    text: {
      type: String,
      required: true
    },
    options: {
      type: String,
      default: 'btn'
    },
    goto: {
      type: String,
      default: null
    }
  },
  methods: {
    handleOptions() {
      if (this.options === 'btn') {
        this.$emit('btn', true)
      } else if (this.options === 'link') {
        this.$router.push({ path: `${this.goto}` })
      }
    }
  }
}
</script>

<style scoped>
.ebutton {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 135px;
  height: 50px;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #777;
  font-size: 16px;
  cursor:pointer;
}
</style>
